package zhuoyue.com.yanjiaohui.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import zhuoyue.com.yanjiaohui.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class PagerFragment extends Fragment {


    public PagerFragment() {
        // Required empty public constructor
    }

    public static PagerFragment newInstance(String data) {

        Bundle args = new Bundle();
        args.putString("data",data);
        PagerFragment fragment = new PagerFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_pager, container, false);

        TextView textView=((TextView) view.findViewById(R.id.fg_tv));
        String data = getArguments().getString("data");
        textView.setText(data);


        return view;

    }

}
